#!/usr/bin/env python

import multiprocessing

def counter(qIm, qRes):
    while True:
        data = qIm.get()
        data = data * 2
        qRes.put(data)
    
if __name__ == '__main__':
    qIm = multiprocessing.Queue(10)
    qRes = multiprocessing.Queue(10)
    p = multiprocessing.Process(target = counter, args = (qIm, qRes))
    p.start()
    for i in range(10):
        qIm.put(i)
        res = qRes.get()
        print("I've put:", str(i), "and I've received:", str(res))
    p.terminate()
